package org.gw.ylc.base.ctrl;

import org.gw.ylc.base.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("department")
public class DepartmentCtrl {
	@Autowired
	private DepartmentService departmentService;

	@RequestMapping("getDepartments")
	@ResponseBody
	public Object getDepartments() {
		return departmentService.findAll();
	}

	@RequestMapping("queryByStatusAndType")
	@ResponseBody
	public Object getDepartmentsByStatusAndType(Integer status, Integer type) {
		return departmentService.findByStatusAndType(status, type);
	}
}
